package structural.proxy;

import java.util.HashMap;
import java.util.Map;

public class Library {
    private final Map<String, IEbook> ebooks = new HashMap<>();

    public void add(IEbook IEbook) {
        ebooks.put(IEbook.fileName(), IEbook);
    }

    public void openEbook(String fileName) {
        if (!ebooks.containsKey(fileName)) {
            System.out.println("Ebook not found: " + fileName);
        }
        ebooks.get(fileName).show();
    }
}
